package com.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class QueueConfig {

    @Bean
    public Queue backQueue(){
        return new Queue("order");
    }

    @Bean
    public Queue backQueue1(){
        return new Queue("order1");
    }

    @Bean
    public Queue backQueue2(){
        return new Queue("order2");
    }

    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("directExchange");
    }


    public Binding binding1(){
        Binding binding = BindingBuilder.bind(backQueue1()).to(directExchange()).with("order1");
        return binding;
    }
    /*@Bean
    public FanoutExchange fanoutExchange(){
        return new FanoutExchange("fanoutExchange");
    }*/

    /*@Bean
    public Binding binding1(){
        Binding binding = BindingBuilder.bind(backQueue1()).to(fanoutExchange());
        return binding;
    }

    @Bean
    public Binding binding2(){
        Binding binding = BindingBuilder.bind(backQueue2()).to(fanoutExchange());
        return binding;
    }*/
}
